package com.flyco.modules.stm.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.flyco.modules.stm.entity.StmStock;
import com.flyco.modules.stm.vo.StmStockEditVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description: 门店库存
 * @Author: flyco
 * @Date:   2020-10-20
 * @Version: V1.0
 */
@DS("store")
@Repository
public interface StmStockMapper extends BaseMapper<StmStock> {

    /**
     * 通用的库存修改的方法
     * 支持一条记录中的所有库位的变更
     * @param editVO
     * @return
     */
    int editStock(@Param("editVO") StmStockEditVO editVO);

    int editStockWithSales(@Param("editVO") StmStockEditVO editVO);

    List<StmStock> getStockPage(Page<StmStock> page, @Param("ew") Wrapper<StmStock> queryWrapper);


}
